<?php
class Factory_infoModel extends BaseModel
{
	var $table  = 'factory_info';
	var $prikey = 'factory_id';
	var $_name  = 'factory_info';
	var $_relation = array(
		'has_sample' => array(
				'model' => 'sample',
				'type' => HAS_MANY,
				'foreign_key' => 'factory_id',
		),
		'belongs_factory_member' => array(
				'model' => 'member',
				'type' => BELONGS_TO,
				'foreign_key' => 'user_id',
				'reverse'       => 'has_factory',
		),
		'has_quote' => array(
				'model' => 'quote',
				'type' => HAS_MANY,
				'foreign_key' => 'factory_id',
		),
		'has_receipt' => array(
				'model' => 'receipt',
				'type' => HAS_MANY,
				'foreign_key' => 'factory_id',
		),
		'has_reconlist'=>array(
				'model' => 'reconlist',
				'type' => HAS_MANY,
				'foreign_key' => 'factory_id',
		)
	);
}